﻿<html>
<header>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" /> 
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> 
    <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script> 
</header>
<script>
$(document).ready(function() {
    $("#check").click(function(){
        $.ajax({
            type: 'POST',
			data:{
				ip: $('#ip_value').val()
			},
            url:  'php/app_test_connection.php',
			cache: false,
            datatype:'JSON',
            success: function(data) {
                alert(data);
				location.reload();
            },
			error: function(data) {
                alert(data);
				location.reload();
            },
        });
    });
});
 
</script>
<body>
        <div data-role="page">
            <div data-role="header" data-dividertheme="a" data-position="fixed"><H1>檢測連線</H1></div>
            <div data-role="content">
				<form method="post" name="form1" action="check.html">
					<h3>請輸入IP:</h3>
					<input type="text" name="ip" id="ip_value" />
					<input type="submit" id="check" value="檢查" />
				</form>
            </div>
            <div data-role="footer" data-position="fixed"><h2>Check_Connection</h2></div>
        </div>
    </div>
</body>
</html>